<template>
  <img :src="url" ref="imgRef" alt="" />
</template>

<script setup>
import { computed, ref } from "vue";
import { useUrl, useWidth } from "./useScale";
const props = defineProps({
  src: {
    type: String,
  },
  imgSet: {
    type: Array,
    default: () => [],
  },
});
const imgRef = ref(null);
const { width } = useWidth(imgRef);
const { url } = useUrl(
  width,
  computed(() => props.src),
  computed(() => props.imgSet)
);
</script>

<style lang="scss" scoped></style>
